package seGobangClient.uiSystem3D;

import java.awt.Graphics;
import java.awt.Image;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author Leo
 */
public class getpane extends JPanel
{

    private static final long serialVersionUID = 1L;
    private int width = 0,  hight = 0;
    public String imgpath = "";

    public getpane(int width, int hight, String file)
    {
        this.width = width;
        this.hight = hight;
        imgpath = file;
    }

    public void setBack(String path)
    {
        imgpath = path;
        repaint();
    }
    
    protected void paintComponent(Graphics g)
    {
        ImageIcon icon = new ImageIcon(imgpath);
        icon.setImage(icon.getImage().getScaledInstance(width, hight, Image.SCALE_DEFAULT));
        g.drawImage(icon.getImage(), 0, 0, width, hight, this);
    }
    }